#!/usr/bin/env node

const fs = require('fs'),
      file = process.argv[2];

if(!fs.existsSync(file)){
  console.error(`${file} not exist!`);
  return ;
}

fs.readFile(file,'utf8',(err,data) => {
  if(err){
       console.error(err.message);
  }else{
    let arr = data.split('\n');
    for(let i = 0;i < arr.length;i++){
      console.log(`${i+1}\t${arr[i]}`);
    } 
  }
})
